<template>
  <h1>Child</h1>
  <p>{{ modelValue }}</p>
  <button @click="$emit('update:modelValue', modelValue + 1)">更新</button>
</template>

<script lang="ts">
export default {
  name: "Child",
  // 声明接受props数据
  props: {
    modelValue: {
      type: Number,
      required: true,
    },
  },
  // 声明接受事件
  emits: ["update:modelValue"],
  mounted() {
    console.log(this);
  },
};
</script>

<style scoped></style>
